<script setup lang="ts">
import { useUserStore } from '@/stores/modules/user';

const userStore = useUserStore();

// 获取用户名
const userName = computed(() => {
  const userInfo = userStore.userInfo;
  return userInfo?.nickName || userInfo?.username;
});

// 是否为游客模式
const isGuestMode = computed(() => userStore.isGuestMode);
</script>

<template>
  <div class="welcome-text">
    你好，<span v-if="!isGuestMode && userName" class="user-name">{{ userName }}</span>我是智能报告系统，很高兴见到你！
  </div>
</template>

<style scoped lang="scss">
.welcome-text {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--el-text-color-primary, #303133);
  text-align: center;
  .user-name {
    font-weight: 600;
    color: var(--el-color-primary, #409eff);
  }
}
</style>
